package com.wtwd.wtwddevice.mapper;

import com.wtwd.wtwddevice.model.entity.DeviceStatus;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author mjy
 * @since 2024-04-28
 */
@Mapper
public interface DeviceStatusMapper extends BaseMapper<DeviceStatus> {

    int insertOrUpdate(DeviceStatus deviceStatus);

    int downLine(@Param("deviceId") Long deviceId,@Param("status") int status, @Param("downlineTime") long downlineTime);

    int updateStatus(@Param("deviceId") Long deviceId, @Param("battery")String battery, @Param("step")String step, @Param("wearingState")String wearingState,@Param("updateTime") Long updateTime);

    Integer getDeviceOnlineState(@Param("deviceId") Long deviceId);

    int editDeviceStatus(@Param("deviceStatus") DeviceStatus deviceStatus);
}
